package com.education.welco.service.impl;


import com.education.common.pojo.LCatalog;
import com.education.common.utils.Convert;
import com.education.welco.mapper.LCatalogMapper;
import com.education.welco.service.ILCatalogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 课程 服务层实现
 *
 * @author d
 * @date 2020-05-08
 */
@Service
public class LCatalogServiceImpl implements ILCatalogService {

    @Autowired
    private LCatalogMapper lCatalogMapper;

    @Override
    public List<LCatalog> selectByFootPrint(Integer userId, Integer catalogId, String createTime ) {
        return lCatalogMapper.selectByFootPrint(userId,catalogId,createTime);
    }

    @Override
    public List<LCatalog> findByUserId(Integer userId,Integer catalogId) {
        return lCatalogMapper.findByUserId(userId,catalogId);
    }

    /**
     * 查询课程信息
     *
     * @param id 课程ID
     * @return 课程信息
     */
    @Override
    public LCatalog selectLCatalogById(Integer id) {
        return lCatalogMapper.selectLCatalogById(id);
    }

    /**
     * 查询课程列表
     *
     * @param lCatalog 课程信息
     * @return 课程集合
     */
    @Override
    public List<LCatalog> selectLCatalogMenuListOther2(LCatalog lCatalog) {
        return lCatalogMapper.selectLCatalogMenuListOther2(lCatalog);
    }

    /**
     * 查询课程列表
     *
     * @param lCatalog 课程信息
     * @return 课程集合
     */
    @Override
    public List<LCatalog> selectLCatalogList(LCatalog lCatalog) {
        return lCatalogMapper.selectLCatalogList(lCatalog);
    }

    /**
     * 新增课程
     *
     * @param lCatalog 课程信息
     * @return 结果
     */
    @Override
    public int insertLCatalog(LCatalog lCatalog) {
        return lCatalogMapper.insertLCatalog(lCatalog);
    }


    /**
     * 删除课程信息
     *
     * @param id 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteLCatalogById(Integer id) {
        return lCatalogMapper.deleteLCatalogById(id);
    }

    /**
     * 修改课程
     *
     * @param lCatalog 课程信息
     * @return 结果
     */
    @Override
    public int updateLCatalog(LCatalog lCatalog) {
        return lCatalogMapper.updateLCatalog(lCatalog);
    }

    /**
     * 删除课程对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteLCatalogByIds(String ids) {
        return lCatalogMapper.deleteLCatalogByIds(Convert.toStrArray(ids));
    }
}